<template>
  <div class="main">
    <AddressMid :address="address"/>
    <div class="right">
      <img :src="edit" @click="handleEdit">
    </div>
  </div>
</template>

<script>
import common from "../../api/common";
import edit from "../../assets/common/edit.png";
import AddressMid from "@/components/address/AddressMid";

import RadioChecked from "../../assets/common/radio-checked.png";
import RadioUnChecked from "../../assets/common/radio-unchecked.png";

export default {
  props: ["address"],
  components: {
    AddressMid
  },
  computed: {
    radioImage() {
      if (this.address.radioCheck) {
        return this.RadioChecked;
      } else {
        return this.RadioUnChecked;
      }
    }
  },
  data() {
    return {
      showCheckbox: true,
      edit,
      RadioChecked,
      RadioUnChecked,
      mode: common.getParam("mode")
    };
  },
  methods: {
    handleEdit() {
      // 点击编辑图标
      this.$routerPush(this, `/pages/address/Add?id=${this.address.id}`);
    }
  }
};
</script>

<style lang="less" scoped>
.main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 4vw;
  padding: 5vw 0;
  border-bottom: 1px solid #e5e5e5;
  .left {
    margin-right: 5vw;
  }
  .right {
    margin-left: 5vw;
    img {
      width: 6vw;
      height: 6vw;
    }
  }
  .radio-icon {
    width: 4vw;
    height: 4vw;
    margin-right: 5vw;
  }
}
</style>